.class public Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;
.super Ljava/lang/Object;
.source "OffsetCurveBuilder.java"


# static fields
.field private static MAX_CLOSING_SEG_LEN:D

.field private static final arrayTypeCoordinate:[Lcom/vividsolutions/jts/geom/Coordinate;


# instance fields
.field private cga:Lcom/vividsolutions/jts/algorithm/CGAlgorithms;

.field private distance:D

.field private endCapStyle:I

.field private filletAngleQuantum:D

.field private li:Lcom/vividsolutions/jts/algorithm/LineIntersector;

.field private maxCurveSegmentError:D

.field private offset0:Lcom/vividsolutions/jts/geom/LineSegment;

.field private offset1:Lcom/vividsolutions/jts/geom/LineSegment;

.field private precisionModel:Lcom/vividsolutions/jts/geom/PrecisionModel;

.field private ptList:Ljava/util/ArrayList;

.field private s0:Lcom/vividsolutions/jts/geom/Coordinate;

.field private s1:Lcom/vividsolutions/jts/geom/Coordinate;

.field private s2:Lcom/vividsolutions/jts/geom/Coordinate;

.field private seg0:Lcom/vividsolutions/jts/geom/LineSegment;

.field private seg1:Lcom/vividsolutions/jts/geom/LineSegment;

.field private side:I


# direct methods
.method static constructor <clinit>()V
    .locals 2

    const/4 v0, 0x0

    .line 62
    new-array v0, v0, [Lcom/vividsolutions/jts/geom/Coordinate;

    sput-object v0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->arrayTypeCoordinate:[Lcom/vividsolutions/jts/geom/Coordinate;

    const-wide/high16 v0, 0x4008000000000000L    # 3.0

    .line 262
    sput-wide v0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->MAX_CLOSING_SEG_LEN:D

    return-void
.end method

.method public constructor <init>(Lcom/vividsolutions/jts/geom/PrecisionModel;I)V
    .locals 2

    .line 90
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 63
    new-instance v0, Lcom/vividsolutions/jts/algorithm/RobustCGAlgorithms;

    invoke-direct {v0}, Lcom/vividsolutions/jts/algorithm/RobustCGAlgorithms;-><init>()V

    iput-object v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->cga:Lcom/vividsolutions/jts/algorithm/CGAlgorithms;

    const-wide/16 v0, 0x0

    .line 74
    iput-wide v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->maxCurveSegmentError:D

    .line 76
    iput-wide v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->distance:D

    const/4 v0, 0x1

    .line 78
    iput v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->endCapStyle:I

    .line 247
    new-instance v1, Lcom/vividsolutions/jts/geom/LineSegment;

    invoke-direct {v1}, Lcom/vividsolutions/jts/geom/LineSegment;-><init>()V

    iput-object v1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->seg0:Lcom/vividsolutions/jts/geom/LineSegment;

    .line 248
    new-instance v1, Lcom/vividsolutions/jts/geom/LineSegment;

    invoke-direct {v1}, Lcom/vividsolutions/jts/geom/LineSegment;-><init>()V

    iput-object v1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->seg1:Lcom/vividsolutions/jts/geom/LineSegment;

    .line 249
    new-instance v1, Lcom/vividsolutions/jts/geom/LineSegment;

    invoke-direct {v1}, Lcom/vividsolutions/jts/geom/LineSegment;-><init>()V

    iput-object v1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->offset0:Lcom/vividsolutions/jts/geom/LineSegment;

    .line 250
    new-instance v1, Lcom/vividsolutions/jts/geom/LineSegment;

    invoke-direct {v1}, Lcom/vividsolutions/jts/geom/LineSegment;-><init>()V

    iput-object v1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->offset1:Lcom/vividsolutions/jts/geom/LineSegment;

    const/4 v1, 0x0

    .line 251
    iput v1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->side:I

    .line 91
    iput-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->precisionModel:Lcom/vividsolutions/jts/geom/PrecisionModel;

    .line 94
    new-instance p1, Lcom/vividsolutions/jts/algorithm/RobustLineIntersector;

    invoke-direct {p1}, Lcom/vividsolutions/jts/algorithm/RobustLineIntersector;-><init>()V

    iput-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->li:Lcom/vividsolutions/jts/algorithm/LineIntersector;

    if-ge p2, v0, :cond_0

    const/4 p2, 0x1

    :cond_0
    const-wide v0, 0x3ff921fb54442d18L    # 1.5707963267948966

    int-to-double p1, p2

    .line 97
    invoke-static {p1, p2}, Ljava/lang/Double;->isNaN(D)Z

    div-double/2addr v0, p1

    iput-wide v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->filletAngleQuantum:D

    return-void
.end method

.method private addCircle(Lcom/vividsolutions/jts/geom/Coordinate;D)V
    .locals 9

    .line 489
    new-instance v0, Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v2, p1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    add-double/2addr v2, p2

    iget-wide v4, p1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    invoke-direct {v0, v2, v3, v4, v5}, Lcom/vividsolutions/jts/geom/Coordinate;-><init>(DD)V

    .line 490
    invoke-direct {p0, v0}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    const-wide/16 v2, 0x0

    const-wide v4, 0x401921fb54442d18L    # 6.283185307179586

    const/4 v6, -0x1

    move-object v0, p0

    move-object v1, p1

    move-wide v7, p2

    .line 491
    invoke-direct/range {v0 .. v8}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addFillet(Lcom/vividsolutions/jts/geom/Coordinate;DDID)V

    return-void
.end method

.method private addFillet(Lcom/vividsolutions/jts/geom/Coordinate;DDID)V
    .locals 17

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    const/4 v2, 0x1

    const/4 v3, -0x1

    move/from16 v4, p6

    if-ne v4, v3, :cond_0

    goto :goto_0

    :cond_0
    const/4 v3, 0x1

    :goto_0
    sub-double v4, p2, p4

    .line 460
    invoke-static {v4, v5}, Ljava/lang/Math;->abs(D)D

    move-result-wide v4

    .line 461
    iget-wide v6, v0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->filletAngleQuantum:D

    div-double v6, v4, v6

    const-wide/high16 v8, 0x3fe0000000000000L    # 0.5

    add-double/2addr v6, v8

    double-to-int v6, v6

    if-ge v6, v2, :cond_1

    return-void

    :cond_1
    const-wide/16 v7, 0x0

    int-to-double v9, v6

    .line 469
    invoke-static {v9, v10}, Ljava/lang/Double;->isNaN(D)Z

    div-double v9, v4, v9

    .line 472
    new-instance v2, Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-direct {v2}, Lcom/vividsolutions/jts/geom/Coordinate;-><init>()V

    :goto_1
    cmpg-double v6, v7, v4

    if-gez v6, :cond_2

    int-to-double v11, v3

    .line 474
    invoke-static {v11, v12}, Ljava/lang/Double;->isNaN(D)Z

    mul-double v11, v11, v7

    add-double v11, p2, v11

    .line 475
    iget-wide v13, v1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    invoke-static {v11, v12}, Ljava/lang/Math;->cos(D)D

    move-result-wide v15

    mul-double v15, v15, p7

    add-double/2addr v13, v15

    iput-wide v13, v2, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    .line 476
    iget-wide v13, v1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    invoke-static {v11, v12}, Ljava/lang/Math;->sin(D)D

    move-result-wide v11

    mul-double v11, v11, p7

    add-double/2addr v13, v11

    iput-wide v13, v2, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    .line 477
    invoke-direct {v0, v2}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    add-double/2addr v7, v9

    goto :goto_1

    :cond_2
    return-void
.end method

.method private addFillet(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;ID)V
    .locals 13

    move-object v9, p0

    move-object v1, p1

    move-object v0, p2

    move-object/from16 v10, p3

    .line 432
    iget-wide v2, v0, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    iget-wide v4, v1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    sub-double/2addr v2, v4

    .line 433
    iget-wide v4, v0, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    iget-wide v6, v1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    sub-double/2addr v4, v6

    .line 434
    invoke-static {v4, v5, v2, v3}, Ljava/lang/Math;->atan2(DD)D

    move-result-wide v2

    .line 435
    iget-wide v4, v10, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    iget-wide v6, v1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    sub-double/2addr v4, v6

    .line 436
    iget-wide v6, v10, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    iget-wide v11, v1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    sub-double/2addr v6, v11

    .line 437
    invoke-static {v6, v7, v4, v5}, Ljava/lang/Math;->atan2(DD)D

    move-result-wide v4

    const-wide v6, 0x401921fb54442d18L    # 6.283185307179586

    const/4 v8, -0x1

    move/from16 v11, p4

    if-ne v11, v8, :cond_0

    cmpg-double v8, v2, v4

    if-gtz v8, :cond_1

    add-double/2addr v2, v6

    goto :goto_0

    :cond_0
    cmpl-double v8, v2, v4

    if-ltz v8, :cond_1

    sub-double/2addr v2, v6

    .line 445
    :cond_1
    :goto_0
    invoke-direct {p0, p2}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    move-object v0, p0

    move-object v1, p1

    move/from16 v6, p4

    move-wide/from16 v7, p5

    .line 446
    invoke-direct/range {v0 .. v8}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addFillet(Lcom/vividsolutions/jts/geom/Coordinate;DDID)V

    .line 447
    invoke-direct {p0, v10}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    return-void
.end method

.method private addLastSegment()V
    .locals 1

    .line 352
    iget-object v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->offset1:Lcom/vividsolutions/jts/geom/LineSegment;

    iget-object v0, v0, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-direct {p0, v0}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    return-void
.end method

.method private addLineEndCap(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V
    .locals 16

    move-object/from16 v9, p0

    move-object/from16 v6, p1

    move-object/from16 v7, p2

    .line 384
    new-instance v8, Lcom/vividsolutions/jts/geom/LineSegment;

    invoke-direct {v8, v6, v7}, Lcom/vividsolutions/jts/geom/LineSegment;-><init>(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 386
    new-instance v10, Lcom/vividsolutions/jts/geom/LineSegment;

    invoke-direct {v10}, Lcom/vividsolutions/jts/geom/LineSegment;-><init>()V

    .line 387
    iget-wide v3, v9, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->distance:D

    const/4 v2, 0x1

    move-object/from16 v0, p0

    move-object v1, v8

    move-object v5, v10

    invoke-direct/range {v0 .. v5}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->computeOffsetSegment(Lcom/vividsolutions/jts/geom/LineSegment;IDLcom/vividsolutions/jts/geom/LineSegment;)V

    .line 388
    new-instance v11, Lcom/vividsolutions/jts/geom/LineSegment;

    invoke-direct {v11}, Lcom/vividsolutions/jts/geom/LineSegment;-><init>()V

    .line 389
    iget-wide v3, v9, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->distance:D

    const/4 v2, 0x2

    move-object v5, v11

    invoke-direct/range {v0 .. v5}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->computeOffsetSegment(Lcom/vividsolutions/jts/geom/LineSegment;IDLcom/vividsolutions/jts/geom/LineSegment;)V

    .line 391
    iget-wide v0, v7, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    iget-wide v2, v6, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    sub-double/2addr v0, v2

    .line 392
    iget-wide v2, v7, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    iget-wide v4, v6, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    sub-double/2addr v2, v4

    .line 393
    invoke-static {v2, v3, v0, v1}, Ljava/lang/Math;->atan2(DD)D

    move-result-wide v0

    .line 395
    iget v2, v9, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->endCapStyle:I

    const/4 v3, 0x1

    if-eq v2, v3, :cond_2

    const/4 v3, 0x2

    if-eq v2, v3, :cond_1

    const/4 v3, 0x3

    if-eq v2, v3, :cond_0

    goto/16 :goto_0

    .line 409
    :cond_0
    new-instance v2, Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-direct {v2}, Lcom/vividsolutions/jts/geom/Coordinate;-><init>()V

    .line 410
    iget-wide v3, v9, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->distance:D

    invoke-static {v3, v4}, Ljava/lang/Math;->abs(D)D

    move-result-wide v3

    invoke-static {v0, v1}, Ljava/lang/Math;->cos(D)D

    move-result-wide v5

    mul-double v3, v3, v5

    iput-wide v3, v2, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    .line 411
    iget-wide v3, v9, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->distance:D

    invoke-static {v3, v4}, Ljava/lang/Math;->abs(D)D

    move-result-wide v3

    invoke-static {v0, v1}, Ljava/lang/Math;->sin(D)D

    move-result-wide v0

    mul-double v3, v3, v0

    iput-wide v3, v2, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    .line 413
    new-instance v0, Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object v1, v10, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v3, v1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    iget-wide v5, v2, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    add-double/2addr v3, v5

    iget-wide v5, v1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    iget-wide v7, v2, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    add-double/2addr v5, v7

    invoke-direct {v0, v3, v4, v5, v6}, Lcom/vividsolutions/jts/geom/Coordinate;-><init>(DD)V

    .line 416
    new-instance v1, Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object v3, v11, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v4, v3, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    iget-wide v6, v2, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    add-double/2addr v4, v6

    iget-wide v6, v3, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    iget-wide v2, v2, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    add-double/2addr v6, v2

    invoke-direct {v1, v4, v5, v6, v7}, Lcom/vividsolutions/jts/geom/Coordinate;-><init>(DD)V

    .line 419
    invoke-direct {v9, v0}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 420
    invoke-direct {v9, v1}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    goto :goto_0

    .line 404
    :cond_1
    iget-object v0, v10, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-direct {v9, v0}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 405
    iget-object v0, v11, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-direct {v9, v0}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    goto :goto_0

    .line 398
    :cond_2
    iget-object v2, v10, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-direct {v9, v2}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    const-wide v2, 0x3ff921fb54442d18L    # 1.5707963267948966

    add-double v4, v0, v2

    sub-double v12, v0, v2

    const/4 v6, -0x1

    .line 399
    iget-wide v14, v9, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->distance:D

    move-object/from16 v0, p0

    move-object/from16 v1, p2

    move-wide v2, v4

    move-wide v4, v12

    move-wide v7, v14

    invoke-direct/range {v0 .. v8}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addFillet(Lcom/vividsolutions/jts/geom/Coordinate;DDID)V

    .line 400
    iget-object v0, v11, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-direct {v9, v0}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    :goto_0
    return-void
.end method

.method private addNextSegment(Lcom/vividsolutions/jts/geom/Coordinate;Z)V
    .locals 9

    .line 267
    iget-object v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s1:Lcom/vividsolutions/jts/geom/Coordinate;

    iput-object v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s0:Lcom/vividsolutions/jts/geom/Coordinate;

    .line 268
    iget-object v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s2:Lcom/vividsolutions/jts/geom/Coordinate;

    iput-object v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s1:Lcom/vividsolutions/jts/geom/Coordinate;

    .line 269
    iput-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s2:Lcom/vividsolutions/jts/geom/Coordinate;

    .line 270
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->seg0:Lcom/vividsolutions/jts/geom/LineSegment;

    iget-object v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s0:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object v1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s1:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-virtual {p1, v0, v1}, Lcom/vividsolutions/jts/geom/LineSegment;->setCoordinates(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 271
    iget-object v3, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->seg0:Lcom/vividsolutions/jts/geom/LineSegment;

    iget v4, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->side:I

    iget-wide v5, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->distance:D

    iget-object v7, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->offset0:Lcom/vividsolutions/jts/geom/LineSegment;

    move-object v2, p0

    invoke-direct/range {v2 .. v7}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->computeOffsetSegment(Lcom/vividsolutions/jts/geom/LineSegment;IDLcom/vividsolutions/jts/geom/LineSegment;)V

    .line 272
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->seg1:Lcom/vividsolutions/jts/geom/LineSegment;

    iget-object v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object v1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s2:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-virtual {p1, v0, v1}, Lcom/vividsolutions/jts/geom/LineSegment;->setCoordinates(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 273
    iget-object v3, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->seg1:Lcom/vividsolutions/jts/geom/LineSegment;

    iget v4, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->side:I

    iget-wide v5, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->distance:D

    iget-object v7, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->offset1:Lcom/vividsolutions/jts/geom/LineSegment;

    invoke-direct/range {v2 .. v7}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->computeOffsetSegment(Lcom/vividsolutions/jts/geom/LineSegment;IDLcom/vividsolutions/jts/geom/LineSegment;)V

    .line 276
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s2:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-virtual {p1, v0}, Lcom/vividsolutions/jts/geom/Coordinate;->equals(Ljava/lang/Object;)Z

    move-result p1

    if-eqz p1, :cond_0

    return-void

    .line 278
    :cond_0
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->cga:Lcom/vividsolutions/jts/algorithm/CGAlgorithms;

    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s0:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object v1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s2:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-static {p1, v0, v1}, Lcom/vividsolutions/jts/algorithm/CGAlgorithms;->computeOrientation(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)I

    move-result v6

    const/4 p1, -0x1

    const/4 v0, 0x2

    const/4 v1, 0x0

    const/4 v2, 0x1

    if-ne v6, p1, :cond_1

    .line 279
    iget p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->side:I

    if-eq p1, v2, :cond_3

    :cond_1
    if-ne v6, v2, :cond_2

    iget p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->side:I

    if-ne p1, v0, :cond_2

    goto :goto_0

    :cond_2
    const/4 v2, 0x0

    :cond_3
    :goto_0
    if-nez v6, :cond_4

    .line 284
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->li:Lcom/vividsolutions/jts/algorithm/LineIntersector;

    iget-object p2, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s0:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object v1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object v2, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s2:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-virtual {p1, p2, v1, v1, v2}, Lcom/vividsolutions/jts/algorithm/LineIntersector;->computeIntersection(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 286
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->li:Lcom/vividsolutions/jts/algorithm/LineIntersector;

    invoke-virtual {p1}, Lcom/vividsolutions/jts/algorithm/LineIntersector;->getIntersectionNum()I

    move-result p1

    if-lt p1, v0, :cond_9

    .line 300
    iget-object v2, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->offset0:Lcom/vividsolutions/jts/geom/LineSegment;

    iget-object v3, p1, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->offset1:Lcom/vividsolutions/jts/geom/LineSegment;

    iget-object v4, p1, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    const/4 v5, -0x1

    iget-wide v6, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->distance:D

    move-object v1, p0

    invoke-direct/range {v1 .. v7}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addFillet(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;ID)V

    goto/16 :goto_1

    :cond_4
    if-eqz v2, :cond_6

    if-eqz p2, :cond_5

    .line 305
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->offset0:Lcom/vividsolutions/jts/geom/LineSegment;

    iget-object p1, p1, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-direct {p0, p1}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 307
    :cond_5
    iget-object v3, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->offset0:Lcom/vividsolutions/jts/geom/LineSegment;

    iget-object v4, p1, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->offset1:Lcom/vividsolutions/jts/geom/LineSegment;

    iget-object v5, p1, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v7, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->distance:D

    move-object v2, p0

    invoke-direct/range {v2 .. v8}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addFillet(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;ID)V

    .line 308
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->offset1:Lcom/vividsolutions/jts/geom/LineSegment;

    iget-object p1, p1, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-direct {p0, p1}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    goto :goto_1

    .line 314
    :cond_6
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->li:Lcom/vividsolutions/jts/algorithm/LineIntersector;

    iget-object p2, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->offset0:Lcom/vividsolutions/jts/geom/LineSegment;

    iget-object v0, p2, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object p2, p2, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object v2, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->offset1:Lcom/vividsolutions/jts/geom/LineSegment;

    iget-object v3, v2, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object v2, v2, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-virtual {p1, v0, p2, v3, v2}, Lcom/vividsolutions/jts/algorithm/LineIntersector;->computeIntersection(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 316
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->li:Lcom/vividsolutions/jts/algorithm/LineIntersector;

    invoke-virtual {p1}, Lcom/vividsolutions/jts/algorithm/LineIntersector;->hasIntersection()Z

    move-result p1

    if-eqz p1, :cond_7

    .line 317
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->li:Lcom/vividsolutions/jts/algorithm/LineIntersector;

    invoke-virtual {p1, v1}, Lcom/vividsolutions/jts/algorithm/LineIntersector;->getIntersection(I)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object p1

    invoke-direct {p0, p1}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    goto :goto_1

    .line 334
    :cond_7
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->offset0:Lcom/vividsolutions/jts/geom/LineSegment;

    iget-object p1, p1, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object p2, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->offset1:Lcom/vividsolutions/jts/geom/LineSegment;

    iget-object p2, p2, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-virtual {p1, p2}, Lcom/vividsolutions/jts/geom/Coordinate;->distance(Lcom/vividsolutions/jts/geom/Coordinate;)D

    move-result-wide p1

    iget-wide v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->distance:D

    const-wide v2, 0x408f400000000000L    # 1000.0

    div-double/2addr v0, v2

    cmpg-double v2, p1, v0

    if-gez v2, :cond_8

    .line 335
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->offset0:Lcom/vividsolutions/jts/geom/LineSegment;

    iget-object p1, p1, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-direct {p0, p1}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    goto :goto_1

    .line 339
    :cond_8
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->offset0:Lcom/vividsolutions/jts/geom/LineSegment;

    iget-object p1, p1, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-direct {p0, p1}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 341
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s1:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-direct {p0, p1}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 342
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->offset1:Lcom/vividsolutions/jts/geom/LineSegment;

    iget-object p1, p1, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-direct {p0, p1}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    :cond_9
    :goto_1
    return-void
.end method

.method private addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V
    .locals 3

    .line 223
    new-instance v0, Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-direct {v0, p1}, Lcom/vividsolutions/jts/geom/Coordinate;-><init>(Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 224
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->precisionModel:Lcom/vividsolutions/jts/geom/PrecisionModel;

    invoke-virtual {p1, v0}, Lcom/vividsolutions/jts/geom/PrecisionModel;->makePrecise(Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 227
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->ptList:Ljava/util/ArrayList;

    invoke-virtual {p1}, Ljava/util/ArrayList;->size()I

    move-result p1

    const/4 v1, 0x1

    if-lt p1, v1, :cond_0

    .line 228
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->ptList:Ljava/util/ArrayList;

    invoke-virtual {p1}, Ljava/util/ArrayList;->size()I

    move-result v2

    sub-int/2addr v2, v1

    invoke-virtual {p1, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/vividsolutions/jts/geom/Coordinate;

    goto :goto_0

    :cond_0
    const/4 p1, 0x0

    :goto_0
    if-eqz p1, :cond_1

    .line 229
    invoke-virtual {v0, p1}, Lcom/vividsolutions/jts/geom/Coordinate;->equals(Ljava/lang/Object;)Z

    move-result p1

    if-eqz p1, :cond_1

    return-void

    .line 231
    :cond_1
    iget-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->ptList:Ljava/util/ArrayList;

    invoke-virtual {p1, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    return-void
.end method

.method private addSquare(Lcom/vividsolutions/jts/geom/Coordinate;D)V
    .locals 5

    .line 500
    new-instance v0, Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v1, p1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    add-double/2addr v1, p2

    iget-wide v3, p1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    add-double/2addr v3, p2

    invoke-direct {v0, v1, v2, v3, v4}, Lcom/vividsolutions/jts/geom/Coordinate;-><init>(DD)V

    invoke-direct {p0, v0}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 501
    new-instance v0, Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v1, p1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    add-double/2addr v1, p2

    iget-wide v3, p1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    sub-double/2addr v3, p2

    invoke-direct {v0, v1, v2, v3, v4}, Lcom/vividsolutions/jts/geom/Coordinate;-><init>(DD)V

    invoke-direct {p0, v0}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 502
    new-instance v0, Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v1, p1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    sub-double/2addr v1, p2

    iget-wide v3, p1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    sub-double/2addr v3, p2

    invoke-direct {v0, v1, v2, v3, v4}, Lcom/vividsolutions/jts/geom/Coordinate;-><init>(DD)V

    invoke-direct {p0, v0}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 503
    new-instance v0, Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v1, p1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    sub-double/2addr v1, p2

    iget-wide v3, p1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    add-double/2addr v3, p2

    invoke-direct {v0, v1, v2, v3, v4}, Lcom/vividsolutions/jts/geom/Coordinate;-><init>(DD)V

    invoke-direct {p0, v0}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 504
    new-instance v0, Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v1, p1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    add-double/2addr v1, p2

    iget-wide v3, p1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    add-double/2addr v3, p2

    invoke-direct {v0, v1, v2, v3, v4}, Lcom/vividsolutions/jts/geom/Coordinate;-><init>(DD)V

    invoke-direct {p0, v0}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    return-void
.end method

.method private closePts()V
    .locals 5

    .line 236
    iget-object v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->ptList:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    const/4 v1, 0x1

    if-ge v0, v1, :cond_0

    return-void

    .line 237
    :cond_0
    new-instance v0, Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object v2, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->ptList:Ljava/util/ArrayList;

    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-direct {v0, v2}, Lcom/vividsolutions/jts/geom/Coordinate;-><init>(Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 238
    iget-object v2, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->ptList:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v3

    sub-int/2addr v3, v1

    invoke-virtual {v2, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/vividsolutions/jts/geom/Coordinate;

    .line 240
    iget-object v2, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->ptList:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v2

    const/4 v3, 0x2

    if-lt v2, v3, :cond_1

    .line 241
    iget-object v2, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->ptList:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v4

    sub-int/2addr v4, v3

    invoke-virtual {v2, v4}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/vividsolutions/jts/geom/Coordinate;

    .line 242
    :cond_1
    invoke-virtual {v0, v1}, Lcom/vividsolutions/jts/geom/Coordinate;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_2

    return-void

    .line 243
    :cond_2
    iget-object v1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->ptList:Ljava/util/ArrayList;

    invoke-virtual {v1, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    return-void
.end method

.method private computeLineBufferCurve([Lcom/vividsolutions/jts/geom/Coordinate;)V
    .locals 7

    .line 187
    array-length v0, p1

    const/4 v1, 0x1

    sub-int/2addr v0, v1

    const/4 v2, 0x0

    .line 190
    aget-object v3, p1, v2

    aget-object v4, p1, v1

    invoke-direct {p0, v3, v4, v1}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->initSideSegments(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;I)V

    const/4 v3, 0x2

    const/4 v4, 0x2

    :goto_0
    if-gt v4, v0, :cond_0

    .line 192
    aget-object v5, p1, v4

    invoke-direct {p0, v5, v1}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addNextSegment(Lcom/vividsolutions/jts/geom/Coordinate;Z)V

    add-int/lit8 v4, v4, 0x1

    goto :goto_0

    .line 194
    :cond_0
    invoke-direct {p0}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addLastSegment()V

    add-int/lit8 v4, v0, -0x1

    .line 196
    aget-object v5, p1, v4

    aget-object v6, p1, v0

    invoke-direct {p0, v5, v6}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addLineEndCap(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 199
    aget-object v5, p1, v0

    aget-object v4, p1, v4

    invoke-direct {p0, v5, v4, v1}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->initSideSegments(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;I)V

    sub-int/2addr v0, v3

    :goto_1
    if-ltz v0, :cond_1

    .line 201
    aget-object v3, p1, v0

    invoke-direct {p0, v3, v1}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addNextSegment(Lcom/vividsolutions/jts/geom/Coordinate;Z)V

    add-int/lit8 v0, v0, -0x1

    goto :goto_1

    .line 203
    :cond_1
    invoke-direct {p0}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addLastSegment()V

    .line 205
    aget-object v0, p1, v1

    aget-object p1, p1, v2

    invoke-direct {p0, v0, p1}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addLineEndCap(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 207
    invoke-direct {p0}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->closePts()V

    return-void
.end method

.method private computeOffsetSegment(Lcom/vividsolutions/jts/geom/LineSegment;IDLcom/vividsolutions/jts/geom/LineSegment;)V
    .locals 10

    const/4 v0, 0x1

    if-ne p2, v0, :cond_0

    goto :goto_0

    :cond_0
    const/4 v0, -0x1

    .line 367
    :goto_0
    iget-object p2, p1, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v1, p2, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    iget-object v3, p1, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v4, v3, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    sub-double/2addr v1, v4

    .line 368
    iget-wide v4, p2, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    iget-wide v6, v3, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    sub-double/2addr v4, v6

    mul-double v6, v1, v1

    mul-double v8, v4, v4

    add-double/2addr v6, v8

    .line 369
    invoke-static {v6, v7}, Ljava/lang/Math;->sqrt(D)D

    move-result-wide v6

    int-to-double v8, v0

    .line 371
    invoke-static {v8, v9}, Ljava/lang/Double;->isNaN(D)Z

    mul-double v8, v8, p3

    mul-double v1, v1, v8

    div-double/2addr v1, v6

    mul-double v8, v8, v4

    div-double/2addr v8, v6

    .line 373
    iget-object p2, p5, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object p3, p1, Lcom/vividsolutions/jts/geom/LineSegment;->p0:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide v3, p3, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    sub-double/2addr v3, v8

    iput-wide v3, p2, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    .line 374
    iget-wide p3, p3, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    add-double/2addr p3, v1

    iput-wide p3, p2, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    .line 375
    iget-object p2, p5, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object p1, p1, Lcom/vividsolutions/jts/geom/LineSegment;->p1:Lcom/vividsolutions/jts/geom/Coordinate;

    iget-wide p3, p1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    sub-double/2addr p3, v8

    iput-wide p3, p2, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    .line 376
    iget-wide p3, p1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    add-double/2addr p3, v1

    iput-wide p3, p2, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    return-void
.end method

.method private computeRingBufferCurve([Lcom/vividsolutions/jts/geom/Coordinate;I)V
    .locals 5

    .line 212
    array-length v0, p1

    const/4 v1, 0x1

    sub-int/2addr v0, v1

    add-int/lit8 v2, v0, -0x1

    .line 213
    aget-object v2, p1, v2

    const/4 v3, 0x0

    aget-object v4, p1, v3

    invoke-direct {p0, v2, v4, p2}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->initSideSegments(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;I)V

    const/4 p2, 0x1

    :goto_0
    if-gt p2, v0, :cond_1

    if-eq p2, v1, :cond_0

    const/4 v2, 0x1

    goto :goto_1

    :cond_0
    const/4 v2, 0x0

    .line 216
    :goto_1
    aget-object v4, p1, p2

    invoke-direct {p0, v4, v2}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addNextSegment(Lcom/vividsolutions/jts/geom/Coordinate;Z)V

    add-int/lit8 p2, p2, 0x1

    goto :goto_0

    .line 218
    :cond_1
    invoke-direct {p0}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->closePts()V

    return-void
.end method

.method private static copyCoordinates([Lcom/vividsolutions/jts/geom/Coordinate;)[Lcom/vividsolutions/jts/geom/Coordinate;
    .locals 4

    .line 161
    array-length v0, p0

    new-array v0, v0, [Lcom/vividsolutions/jts/geom/Coordinate;

    const/4 v1, 0x0

    .line 162
    :goto_0
    array-length v2, v0

    if-ge v1, v2, :cond_0

    .line 163
    new-instance v2, Lcom/vividsolutions/jts/geom/Coordinate;

    aget-object v3, p0, v1

    invoke-direct {v2, v3}, Lcom/vividsolutions/jts/geom/Coordinate;-><init>(Lcom/vividsolutions/jts/geom/Coordinate;)V

    aput-object v2, v0, v1

    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    :cond_0
    return-object v0
.end method

.method private getCoordinates()[Lcom/vividsolutions/jts/geom/Coordinate;
    .locals 4

    .line 176
    iget-object v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->ptList:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    const/4 v1, 0x1

    if-le v0, v1, :cond_0

    .line 177
    iget-object v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->ptList:Ljava/util/ArrayList;

    const/4 v2, 0x0

    invoke-virtual {v0, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/vividsolutions/jts/geom/Coordinate;

    .line 178
    iget-object v2, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->ptList:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v3

    sub-int/2addr v3, v1

    invoke-virtual {v2, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/vividsolutions/jts/geom/Coordinate;

    .line 179
    invoke-virtual {v0, v1}, Lcom/vividsolutions/jts/geom/Coordinate;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_0

    invoke-direct {p0, v0}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addPt(Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 181
    :cond_0
    iget-object v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->ptList:Ljava/util/ArrayList;

    sget-object v1, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->arrayTypeCoordinate:[Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [Lcom/vividsolutions/jts/geom/Coordinate;

    return-object v0
.end method

.method private init(D)V
    .locals 4

    .line 169
    iput-wide p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->distance:D

    .line 170
    iget-wide v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->filletAngleQuantum:D

    const-wide/high16 v2, 0x4000000000000000L    # 2.0

    div-double/2addr v0, v2

    invoke-static {v0, v1}, Ljava/lang/Math;->cos(D)D

    move-result-wide v0

    const-wide/high16 v2, 0x3ff0000000000000L    # 1.0

    sub-double/2addr v2, v0

    mul-double p1, p1, v2

    iput-wide p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->maxCurveSegmentError:D

    .line 171
    new-instance p1, Ljava/util/ArrayList;

    invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V

    iput-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->ptList:Ljava/util/ArrayList;

    return-void
.end method

.method private initSideSegments(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;I)V
    .locals 7

    .line 255
    iput-object p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s1:Lcom/vividsolutions/jts/geom/Coordinate;

    .line 256
    iput-object p2, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->s2:Lcom/vividsolutions/jts/geom/Coordinate;

    .line 257
    iput p3, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->side:I

    .line 258
    iget-object v0, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->seg1:Lcom/vividsolutions/jts/geom/LineSegment;

    invoke-virtual {v0, p1, p2}, Lcom/vividsolutions/jts/geom/LineSegment;->setCoordinates(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 259
    iget-object v2, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->seg1:Lcom/vividsolutions/jts/geom/LineSegment;

    iget-wide v4, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->distance:D

    iget-object v6, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->offset1:Lcom/vividsolutions/jts/geom/LineSegment;

    move-object v1, p0

    move v3, p3

    invoke-direct/range {v1 .. v6}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->computeOffsetSegment(Lcom/vividsolutions/jts/geom/LineSegment;IDLcom/vividsolutions/jts/geom/LineSegment;)V

    return-void
.end method


# virtual methods
.method public getLineCurve([Lcom/vividsolutions/jts/geom/Coordinate;D)Ljava/util/List;
    .locals 4

    .line 113
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    const-wide/16 v1, 0x0

    cmpg-double v3, p2, v1

    if-gtz v3, :cond_0

    return-object v0

    .line 117
    :cond_0
    invoke-direct {p0, p2, p3}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->init(D)V

    .line 118
    array-length v1, p1

    const/4 v2, 0x1

    if-gt v1, v2, :cond_3

    .line 119
    iget v1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->endCapStyle:I

    const/4 v3, 0x0

    if-eq v1, v2, :cond_2

    const/4 v2, 0x3

    if-eq v1, v2, :cond_1

    goto :goto_0

    .line 124
    :cond_1
    aget-object p1, p1, v3

    invoke-direct {p0, p1, p2, p3}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addSquare(Lcom/vividsolutions/jts/geom/Coordinate;D)V

    goto :goto_0

    .line 121
    :cond_2
    aget-object p1, p1, v3

    invoke-direct {p0, p1, p2, p3}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->addCircle(Lcom/vividsolutions/jts/geom/Coordinate;D)V

    goto :goto_0

    .line 130
    :cond_3
    invoke-direct {p0, p1}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->computeLineBufferCurve([Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 131
    :goto_0
    invoke-direct {p0}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->getCoordinates()[Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object p1

    .line 132
    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    return-object v0
.end method

.method public getRingCurve([Lcom/vividsolutions/jts/geom/Coordinate;ID)Ljava/util/List;
    .locals 4

    .line 144
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 145
    invoke-direct {p0, p3, p4}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->init(D)V

    .line 146
    array-length v1, p1

    const/4 v2, 0x2

    if-gt v1, v2, :cond_0

    .line 147
    invoke-virtual {p0, p1, p3, p4}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->getLineCurve([Lcom/vividsolutions/jts/geom/Coordinate;D)Ljava/util/List;

    move-result-object p1

    return-object p1

    :cond_0
    const-wide/16 v1, 0x0

    cmpl-double v3, p3, v1

    if-nez v3, :cond_1

    .line 151
    invoke-static {p1}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->copyCoordinates([Lcom/vividsolutions/jts/geom/Coordinate;)[Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object p1

    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    return-object v0

    .line 154
    :cond_1
    invoke-direct {p0, p1, p2}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->computeRingBufferCurve([Lcom/vividsolutions/jts/geom/Coordinate;I)V

    .line 155
    invoke-direct {p0}, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->getCoordinates()[Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object p1

    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    return-object v0
.end method

.method public setEndCapStyle(I)V
    .locals 0

    .line 102
    iput p1, p0, Lcom/vividsolutions/jts/operation/buffer/OffsetCurveBuilder;->endCapStyle:I

    return-void
.end method
